#include<stdio.h>
#include<stdlib.h>
#include<getopt.h>


int main(int argc, char **argv)
{
  int c;

  while(1)
    {
static struct option long_options[] =
  {
    {"add",optional_argument,0,'a'},
    {"bobo",required_argument,0,'b'},
    {0,0,0,0}
  };
 int option_index = 0;
 c=getopt_long(argc,argv,"a:b:",
	       long_options,&option_index);

 if(c == -1)
   break;

 switch(c)
   {
   case 'a':
     printf("add with arg %s\n",optarg);
     break;
   case 'b':
     printf("bobo with arg %s\n",optarg);
     break;
   case '?' :
     break;
   }
    }
  return 0;
}
